package beans;

import java.util.ArrayList;
import java.util.List;

public class TasksForUserStoryBean {
	private List<TaskBean> tasksList = new ArrayList<TaskBean>();
	
	public void addRow(TaskBean taskBean) {
		tasksList.add(taskBean);
	}	
	
	public String getJson() {
		StringBuffer sb = new StringBuffer();

		sb.append("{ ");
		sb.append("\"row\": [");
		for (int i = 0; i < tasksList.size(); i++) {
			TaskBean task = tasksList.get(i);
			
			sb.append(task.getJson());
			
			if (i != tasksList.size() - 1) {
				sb.append(",");
			}
		}
		sb.append("]");
		sb.append("}");
	
		return sb.toString();
	}
}